package com.ruoyi.cat.service.impl;

import java.util.Collections;
import java.util.List;

import com.ruoyi.cat.domain.CatTradedetailTable;
import com.ruoyi.cat.domain.DTO.*;
import com.ruoyi.cat.domain.VO.DataScreeningVO;
import com.ruoyi.cat.domain.VO.FinanceVO;
import com.ruoyi.cat.domain.VO.TradedetailTableVO;
import com.ruoyi.cat.mapper.CatTradedetailTableMapper;
import com.ruoyi.cat.service.ICatTradedetailTableService;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 交易明细Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-12-27
 */
@Service
public class CatTradedetailTableServiceImpl implements ICatTradedetailTableService
{
    @Autowired
    private CatTradedetailTableMapper catTradedetailTableMapper;

    /**
     * 查询交易明细
     * 
     * @param id 交易明细主键
     * @return 交易明细
     */
    @Override
    public CatTradedetailTable selectCatTradedetailTableById(Long id)
    {
        return catTradedetailTableMapper.selectCatTradedetailTableById(id);
    }

    /**
     * 查询交易明细列表
     * 
     * @param catTradedetailTable 交易明细
     * @return 交易明细
     */
    @Override
    public List<CatTradedetailTable> selectCatTradedetailTableList(CatTradedetailTable catTradedetailTable)
    {
        return catTradedetailTableMapper.selectCatTradedetailTableList(catTradedetailTable);
    }

    /**
     * 新增交易明细
     * 
     * @param catTradedetailTable 交易明细
     * @return 结果
     */
    @Override
    public int insertCatTradedetailTable(CatTradedetailTable catTradedetailTable)
    {
        catTradedetailTable.setCreateTime(DateUtils.getNowDate());
        return catTradedetailTableMapper.insertCatTradedetailTable(catTradedetailTable);
    }

    @Override
    public CatTradedetailTable selectCatTradedetailTableByOrderNo(String orderNo) {
        return catTradedetailTableMapper.selectCatTradedetailTableByOrderNo(orderNo);
    }

    @Override
    public CatTradedetailTable getTradedetailActivityId(Long activityId) {
        return catTradedetailTableMapper.getTradedetailActivityId(activityId);
    }

    /**
     * 修改交易明细
     * 
     * @param catTradedetailTable 交易明细
     * @return 结果
     */
    @Override
    public int updateCatTradedetailTable(CatTradedetailTable catTradedetailTable)
    {
        return catTradedetailTableMapper.updateCatTradedetailTable(catTradedetailTable);
    }

    @Override
    public int updateCatTradedetailTableOrderNo(CatTradedetailTable catTradedetailTable) {
        return catTradedetailTableMapper.updateCatTradedetailTableOrderNo(catTradedetailTable);
    }

    /**
     * 批量删除交易明细
     * 
     * @param ids 需要删除的交易明细主键
     * @return 结果
     */
    @Override
    public int deleteCatTradedetailTableByIds(Long[] ids)
    {
        return catTradedetailTableMapper.deleteCatTradedetailTableByIds(ids);
    }

    /**
     * 删除交易明细信息
     * 
     * @param id 交易明细主键
     * @return 结果
     */
    @Override
    public int deleteCatTradedetailTableById(Long id)
    {
        return catTradedetailTableMapper.deleteCatTradedetailTableById(id);
    }

    @Override
    public List<TradedetailTableDTO> selectCatTradedetailTableApiList(TradedetailTableVO tradedetailTableVO) {
        return catTradedetailTableMapper.selectCatTradedetailTableApiList(tradedetailTableVO);
    }

    @Override
    public TotalAmountDTO getTotalAmout(Long userId) {
        return catTradedetailTableMapper.getTotalAmout(userId);
    }

    @Override
    public List<CatTradedetailTable> getTaskJF(CatTradedetailTable catTradedetailTable) {
        return catTradedetailTableMapper.getTaskJF(catTradedetailTable);
    }

    @Override
    public List<AwesomeTeammateDTO> getAwesomeTeammate(DataScreeningVO dataScreeningVO) {
        return catTradedetailTableMapper.getAwesomeTeammate(dataScreeningVO);
    }

    @Override
    public AwesomeTeammateDTO getUserIdData(DataScreeningVO dataScreeningVO) {
        return catTradedetailTableMapper.getUserIdData(dataScreeningVO);
    }

    @Override
    public AwesomeTeammateDTO getUserIdTest(DataScreeningVO dataScreeningVO) {
        return catTradedetailTableMapper.getUserIdTest(dataScreeningVO);
    }

    @Override
    public AwesomeTeammateDTO countByReferenceId(Long referenceId) {
        return catTradedetailTableMapper.countByReferenceId(referenceId);
    }

    @Override
    public List<FinanceDTO> selectTable(FinanceVO financeVO) {
        return catTradedetailTableMapper.selectTable(financeVO);
    }

    @Override
    public ExpensesDTO getTradeNumData(FinanceVO financeVO) {
        return catTradedetailTableMapper.getTradeNumData(financeVO);
    }

    @Override
    public List<TradeNumGroupDTO> getTradeNumGroupBy(FinanceVO financeVO) {
        return catTradedetailTableMapper.getTradeNumGroupBy(financeVO);
    }

    @Override
    public int updateCatTradedetailAndUserId(CatTradedetailTable catTradedetailTable) {
        return catTradedetailTableMapper.updateCatTradedetailAndUserId(catTradedetailTable);
    }
}
